<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    body{
      padding-top: 200px;
      height: 3000px;
    }
    div{
      margin: 100px;
      overflow: scroll;
      width: 200px;
      height: 200px;
      border: 1px solid #000;
    }
  </style>
</head>
<body>
  <div>
    七七七七七七七七七七七七
    七七七七七七七七七七七七
    七七七七七七七七七七七七
    七七七七七七七七七七七七
    七七七七七七七七七七七七
    七七七七七七七七七七七七
    七七七七七七七七七七七七
    七七七七七七七七七七七七
    七七七七七七七七七七七七
    七七七七七七七七七七七七
    七七七七七七七七七七七七
  </div>
  <script>
    const div = document.querySelector('div')
    div.addEventListener('scroll',function(){
      console.log(div.scrollTop);
    })
  </script>
</body>
</html>